package com.ynding.cloud.auth.server.admin.controller;


import com.ynding.cloud.auth.server.admin.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ynding
 */
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
@Api(value="User",tags={"User-Controller"})
public class UserController {

    private final IUserService userService;

    @GetMapping("/loadUserByUsername")
    @ApiOperation(value = "根据用户名称查找用户", produces = "application/json")
    public UserDetails loadUserByUsername(@ApiParam("用户名") String username) {
        return userService.loadUserByUsername(username);
    }

}

